package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	word_map := make(map[string]int)

	scanner.Split(bufio.ScanWords)
	for scanner.Scan() {
		word := scanner.Text()
		word_map[word]++
	}

	if scanner.Err() != nil {
		fmt.Fprintf(os.Stdout, "%v\n", scanner.Err())
		return
	}
	for k, v := range word_map {
		fmt.Printf("%s, %d", k, v)
	}
}
